Skip to content

Fix CI failures: validate_file return type, missing SPDX headers, test arg typo#23

Merged
bashandbone merged 2 commits intomainfrom
copilot/investigate-ci-test-failures
Mar 27, 2026
Merged

Fix CI failures: validate_file return type, missing SPDX headers, test arg typo#23
bashandbone merged 2 commits intomainfrom
copilot/investigate-ci-test-failures

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

Three independent bugs were causing CI to fail across lint and all test matrix entries.

Changes

  • validator.pyvalidate_file() return value (root cause of 24 test failures): Method signature declared -> tuple[list[...], int, ast.AST | None] but the body unpacked _validate_file_with_metrics() and returned only issues. Every caller (tests + validate_files()) destructured the result as issues, _, _ = validator.validate_file(...), producing ValueError: not enough values to unpack.

    # before
    issues, _, _ = self._validate_file_with_metrics(file_path)
    return issues
    
    # after
    return self._validate_file_with_metrics(file_path)
  • CHANGELOG.md, cliff.toml — missing SPDX headers: reuse lint failed because these two files had no copyright/license information. Added standard SPDX headers matching the rest of the repo.

  • test_ast_parser.py — spurious argument in one test: test_annotated_assignment_attribute_target called parser.parse_file(file_path, "test.module") but parse_file only accepts file_path. Removed the extra argument.

Original prompt

Please investigate why the tests are failing in CI and get them passing again :)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…ent typo

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Agent-Logs-Url: https://github.com/knitli/exportify/sessions/3d21c435-34ca-46c3-a023-3e53e610b0e2
Copilot AI changed the title [WIP] Fix CI test failures Fix CI failures: validate_file return type, missing SPDX headers, test arg typo Mar 24, 2026
Copilot AI requested a review from bashandbone March 24, 2026 21:43
@bashandbone bashandbone requested review from Copilot and removed request for bashandbone March 24, 2026 22:13
@bashandbone bashandbone marked this pull request as ready for review March 24, 2026 22:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes CI failures across tests and reuse lint by aligning APIs with their declared signatures and ensuring SPDX/REUSE compliance for non-code files.

Changes:

  • Fix LateImportValidator.validate_file() to return the full metrics tuple as declared (issues, lateimport count, AST).
  • Add missing SPDX headers to CHANGELOG.md and cliff.toml to satisfy reuse lint.
  • Fix a unit test calling ASTParser.parse_file() with an invalid extra argument.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/test_ast_parser.py Removes an invalid extra argument to parse_file() so the test matches the parser API.
src/exportify/validator/validator.py Makes validate_file() actually return the declared 3-tuple to prevent unpacking errors in callers/tests.
cliff.toml Adds SPDX header for REUSE compliance.
CHANGELOG.md Adds SPDX header (HTML comment style) for REUSE compliance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bashandbone bashandbone merged commit 08a7546 into main Mar 27, 2026
14 checks passed
@bashandbone bashandbone deleted the copilot/investigate-ci-test-failures branch March 27, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants